Roger Federer has lost only four matches in 2017.

Admittedly, his 49 matches are far fewer than that of Rafael Nadal 75 or Alexander Zverev, who has played 79, with two tournaments to go in the calendar year. But losing just four of 49 matches still means an incredible win rate of 92.4%.

On Sunday, playing his 13th final at Swiss Indoors, his home tournament, the top seed came close to losing his fifth match of the year. But in his uncharacteristically characteristic way, the only thing standing between Federer and defeat was his incredible resilience.

Playing Juan Martin del Potro, who has beaten him in Basel finals twice before, Federer did something he doesn’t often have to, especially this season – grind out a win. His 6-7(5), 6-4, 6-3 win in a two and a half hour long match was a lesson in workmanship as he fought back to claim his eighth title in Basel, ATP World Tour-leading seventh title of 2017 and the 95th title of his career. It was his first success against the Argentine at home, having lost in both 2012 and 2013.

Federer was probably not 100% in the final – pulling out of the Paris Masters after the final suggests so – nor was del Potro, playing his fourth straight week on the circuit. But the two battled it out tooth and nail, serve and forehand, in a match that bordered on attritional warfare.

Before the final, Federer had lost only one set this week. Two weeks back, en route his Shanghai Masters title, he had played just one three-setter, against del Potro again. This is the kind of fluency Federer has enjoyed this season. In the limited tournaments he has played, he had breezed through (The US Open notwithstanding.)

But on Sunday, Federer showed that while he may not enjoy it as much, he can wear down the opposition and grind out results, when his own game is not in top-flight. The World No 2 committed an unusual 40 unforced errors, in a series of long shots and failed drops and five double faults. In fact, his frustration at his gratuitous number of errors was evident. At one point, after a misplaced net shot, he just bent over the net in a long-suffering gesture. But as he done repeatedly, he found just enough strength to whip a cross-court pass just wide or place a volley just short.

Three-set struggle

The top seed started the match by breaking in the very first game. But he was promptly broken back – a pattern that would continue for most of the match. In a tightly-contested set, Federer couldn’t close it serving at 5-4 and then squandered a 3-0 lead in the tiebreaker to go a set down.

After the tiebreak, as del Potro won six straight points including one after a stunning 23-shot rally, it looked like the Basel trend would continue. But the world No 2 clawed back in the second set with gritty holds and finally broke in the last game to draw level. Even as the crowd cheered and Federer fist-pumped, there was still very little to choose between the two, who were even wearing similar Nike kits.

And then Federer went a break down to start the decider. This could be it, in a match that was touching the 120-minute mark, this was a tipping point. But cheered by the local crowd, the Swiss then called on some long-held reserve of fuel and stepped on the pedal to break back and blaze his way to four straight games.

From then on, it was a smooth ride as he clinched the championship point and raised his arms in celebration, as a distraught del Potro buried his face in his hands. He would rue the result in a match where all he ever did wrong was go an extra break down in the decider, send the one-odd shot long, lose his focus for a bit. But only that one inch is enough for someone like Federer to break through.

“You’ve been playing great tennis this year. You are in fantastic shape, it’s unbelievable,” del Potro said to Federer after the match. “I would love to be at your age in the same form, but I don’t think so.”

There has been enough and more talk on that form at that age. But 36 years is not the noteworthy number after his latest triumph, it’s 95. With this trophy, Federer is second in the list of most Open Era titles, behind only Jimmy Connors at 109. For someone not chasing records, that seems like a nice target to aim at.